<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<button onclick="login()">login</button>
<script>
    document.cookie = "token=aaa;name=wppp"
    console.log(document.cookie)

    function login() {

    }

    let url = "ws://localhost:8080/handler?token=xxxx"
    let ws = new WebSocket(url);
    ws.onopen = ev => {
        setInterval(function () {
            ws.send("xxx")
        }, 5000)
    }
    ws.onmessage = ev => {
        console.log(ev.data);
    }

</script>
</body>
</html>